#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	vector<int> v;
	for (int i = 0; i < 10; ++i) {
		v.push_back(i);
	}

	vector<int>::iterator pos = find(v.begin(), v.end(), 5);

	cout << *pos << endl;

	vector<int>::reverse_iterator rpos(pos);

	cout << *rpos << endl;

	return 0;
} 

